home *** CD-ROM | disk | FTP | other *** search
/ SGI Desktop Special Edition 1.1 / SGI Desktop Special Edition 1.1.iso / dist / acrobat.idb / usr / adobe / DPSNXBasic_2.1.1 / bin / dpsnx.agent.z / dpsnx.agent
Encoding:
Text File  |  1995-11-13  |  2.3 KB  |  91 lines

  1. #!/bin/sh
  2. #
  3. # Launch script for Adobe ShowPS PostScript Previewer
  4. # Copyright 1994, Adobe Systems Incorporated
  5. #
  6. MAJOR_VERSION=2
  7. MINOR_VERSION=1
  8. REVISION=2a
  9. LAST_INSTALL_DATE="Fri Jun 16 17:31:19 PDT 1995"
  10. #
  11. # The process running this script can define and export
  12. # DPSNX_EXTRA_PSRES to add additional resources to the :: default
  13. # for NX.
  14. #
  15. EXECNAME=dpsnx.agent.exec
  16. INSTALL_DIR=/usr/adobe/DPSNXBasic_2.1.1
  17. if [ ! -d "$INSTALL_DIR" ] ; then
  18.     INSTALL_DIR=${DPSNXBASIC_HOME:-"/usr/adobe/DPSNXBasic_${MAJOR_VERSION}.${MINOR_VERSION}"}
  19.     if [ ! -d "$INSTALL_DIR" ] ; then
  20.     # Try to determine automatically the parent directory to this launch script.
  21.     thisscriptname=$0
  22.  
  23.     # Follow any symbolic links in thisscriptname.
  24.     while : ; do
  25.         lsresult=`ls -l $thisscriptname`
  26.         symlink=`expr "$lsresult" : '.*>'.*`
  27.  
  28.         if [ "$symlink" -gt 0 ] ; then
  29.             oldscriptname="$thisscriptname"
  30.             thisscriptname=`echo $lsresult | sed -e 's/^.*-> *\(.*\) *$/\1/g'`
  31.             abspath_new=`expr "$thisscriptname" : '^/'`
  32.             if [ $abspath_new != 1 ] ; then
  33.                 abspath_old=`expr "$oldscriptname" : '^/'`
  34.                 if [ $abspath_old != 1 ] ; then
  35.                     olddir=`pwd`
  36.                 else
  37.                     olddir=`expr "$oldscriptname" : '\(.*\)/'`
  38.                 fi
  39.                 thisscriptname="$olddir/$thisscriptname"
  40.             fi
  41.         else
  42.             break
  43.         fi
  44.     done
  45.  
  46.     # Determine directory containing this shell script.
  47.     scriptdir=`expr $thisscriptname : '\(.*\)/'` 
  48.     if [ "$scriptdir" = "" -o "$scriptdir" = "." ] ; then
  49.         scriptdir=`pwd`
  50.     fi
  51.  
  52.     # Determine root directory for installation ($scriptdir/..).
  53.     parentdir=`expr $scriptdir : '\(.*\)/'` 
  54.  
  55.     if [ -r "$parentdir/exec/$EXECNAME" ] ; then
  56.         INSTALL_DIR="$parentdir"
  57.     fi
  58.     fi
  59. fi
  60. if [ ! -d "$INSTALL_DIR" ] ; then
  61.     echo "showps: Error: can't find ShowPS program."
  62.     exit 1
  63. fi
  64.  
  65. DEFAULT_PSRES="/usr/adobe/DPSNXBasic_2.1.1/psres"
  66. EXEC_DIR="$INSTALL_DIR/exec"
  67. DPSNXPSRES="${DPSNXPSRES:-$HOME/psres:/usr/psres:$DEFAULT_PSRES}"
  68. DPSNXPSRES=${DPSNX_EXTRA_PSRES:+"$DPSNX_EXTRA_PSRES":}$DPSNXPSRES
  69. export DPSNXPSRES
  70.  
  71. opt=""
  72. while [ $# -gt 0 ] ; do
  73.         case "$1" in
  74.         -psres)
  75.                 case "$DPSNXBC" in
  76.                 1.0) ;;
  77.                 *) opt="$opt $1 $2" ;;
  78.                 esac
  79.                 shift 2
  80.                 ;;
  81.         *)
  82.                 opt="$opt $1"
  83.                 shift
  84.                 ;;
  85.         esac
  86. done
  87.  
  88. cd $EXEC_DIR || exit 1
  89.  
  90. exec ./$EXECNAME $opt
  91.